from django.utils import simplejson
from dajaxice.decorators import dajaxice_register
from social.models import *


@dajaxice_register
def dajaxice_example(request, text, user):
    postText = Post.objects.create(text=text)
    postText.save()
    postingUser = User.objects.get(id=7)
    postingUser.createdPosts.add(postText)
    postingUser.save()
    return simplejson.dumps({'user':user , 'message':text})